home *** CD-ROM | disk | FTP | other *** search
/ The Best of MacTutor - S…e Code for Volumes 1 to 5 / The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin / Source Code / #07 (Mar 86) / Pascal 2-3 / Small Flight Source / Small Flight.Asm < prev    next >
Assembly Source File  |  1986-02-13  |  5KB  |  284 lines

  1.         string_format   0
  2.     xdef        PAS$Xfer
  3. PAS$Xfer
  4.     jmp        smallflight
  5.     xdef        fontdata
  6. fontdata    ds.b        26
  7.     xdef        fontptr
  8. fontptr    ds.b        4
  9.     xdef        fontadj
  10. fontadj    ds.b        4
  11.     xdef        patalign
  12. patalign    ds.b        4
  13.     xdef        polymax
  14. polymax    ds.b        2
  15.     xdef        thepoly
  16. thepoly    ds.b        4
  17.     xdef        playindex
  18. playindex    ds.b        2
  19.     xdef        playpic
  20. playpic    ds.b        4
  21.     xdef        rgnmax
  22. rgnmax    ds.b        2
  23.     xdef        rgnindex
  24. rgnindex    ds.b        2
  25.     xdef        rgnbuf
  26. rgnbuf    ds.b        4
  27.     xdef        widedata
  28. widedata    ds.b        10
  29.     xdef        widemaster
  30. widemaster    ds.b        4
  31.     xdef        wideopen
  32. wideopen    ds.b        4
  33.     xdef        randseed
  34. randseed    ds.b        4
  35.     xdef        screenbits
  36. screenbits    ds.b        14
  37.     xdef        arrow
  38. arrow    ds.b        68
  39.     xdef        dkgray
  40. dkgray    ds.b        8
  41.     xdef        ltgray
  42. ltgray    ds.b        8
  43.     xdef        gray
  44. gray    ds.b        8
  45.     xdef        black
  46. black    ds.b        8
  47.     xdef        white
  48. white    ds.b        8
  49.     xdef        theport
  50. theport    ds.b        4
  51.     xdef        stars
  52. stars    ds.b        1410
  53.     xdef        bounds
  54. bounds    ds.b        8
  55.     xdef        sorigin
  56. sorigin    ds.b        4
  57.     xdef        myport
  58. myport    ds.b        108
  59.     xdef        anevent
  60. anevent    ds.b        16
  61.     xdef        makestar
  62. makestar
  63.     link        A6,#-4    
  64.     movem.l        A4/D7,-(SP)                 
  65.     movea.l        8(A6),A4
  66.     clr.w        -(SP)
  67.     dc.w        $A861
  68.     move.w        (SP)+,D7
  69.     ext.l        D7
  70.     divs.w        #64,D7
  71.     swap        D7
  72.     move.w        D7,2(A4)
  73.     movea.l        8(A6),A4
  74.     clr.w        -(SP)
  75.     dc.w        $A861
  76.     move.w        (SP)+,D7
  77.     ext.l        D7
  78.     divs.w        #64,D7
  79.     swap        D7
  80.     move.w        D7,(A4)
  81.     movea.l        8(A6),A4
  82.     move.w        #200,4(A4)
  83.     movea.l        8(A6),A4
  84.     move.w        2(A4),D7
  85.     muls.w        #200,D7
  86.     movea.l        8(A6),A4
  87.     ext.l        D7
  88.     divs.w        4(A4),D7
  89.     move.w        D7,-2(A6)
  90.     movea.l        8(A6),A4
  91.     move.w        sorigin+2(A5),D7
  92.     add.w        -2(A6),D7
  93.     move.w        D7,8(A4)
  94.     movea.l        8(A6),A4
  95.     move.w        (A4),D7
  96.     muls.w        #200,D7
  97.     movea.l        8(A6),A4
  98.     ext.l        D7
  99.     divs.w        4(A4),D7
  100.     move.w        D7,-4(A6)
  101.     movea.l        8(A6),A4
  102.     move.w        sorigin(A5),D7
  103.     add.w        -4(A6),D7
  104.     move.w        D7,6(A4)
  105.     movea.l        8(A6),A4
  106.     move.w        8(A4),-(SP)
  107.     movea.l        8(A6),A4
  108.     move.w        6(A4),-(SP)
  109.     jsr.w        flippix
  110.     movem.l        (SP)+,A4/D7
  111.     unlk        A6
  112.     movea.l        (SP)+,A0
  113.     addq.l        #4,SP
  114.     jmp        (A0)
  115.     xdef        initialize
  116. initialize
  117.     link        A6,#-2    
  118.     movem.l        A4/D6/D7,-(SP)              
  119.     lea        theport(A5),A4
  120.     move.l        A4,-(SP)
  121.     dc.w        $A86E
  122.     lea        myport(A5),A4
  123.     move.l        A4,-(SP)
  124.     dc.w        $A86F
  125.     dc.w        $A850
  126.     move.l        screenbits+6(A5),bounds(A5)
  127.     move.l        screenbits+10(A5),bounds+4(A5)
  128.     pea        bounds(A5)
  129.     move.w        #25,-(SP)
  130.     move.w        #30,-(SP)
  131.     dc.w        $A8A9
  132.     move.w        bounds+2(A5),D7
  133.     add.w        bounds+6(A5),D7
  134.     ext.l        D7
  135.     divs.w        #2,D7
  136.     move.w        D7,sorigin+2(A5)
  137.     move.w        bounds(A5),D7
  138.     add.w        bounds+4(A5),D7
  139.     ext.l        D7
  140.     divs.w        #2,D7
  141.     move.w        D7,sorigin(A5)
  142.     pea        myport+16(A5)
  143.     dc.w        $A8A3
  144.     pea        bounds(A5)
  145.     dc.w        $A8A4
  146.     pea        bounds(A5)
  147.     move.w        sorigin+2(A5),D7
  148.     neg.w        D7
  149.     move.w        D7,-(SP)
  150.     move.w        sorigin(A5),D7
  151.     neg.w        D7
  152.     move.w        D7,-(SP)
  153.     dc.w        $A8A8
  154.     move.w        #1,-2(A6)
  155.     move.w        #140,D7
  156.     cmp.w        -2(A6),D7
  157.     blt.w        sl2il2
  158. sl2il1
  159.     move.w        -2(A6),D6
  160.     muls.w        #10,D6
  161.     lea        stars(A5),A4
  162.     pea        (A4,D6.w)
  163.     jsr.w        makestar
  164.     cmp.w        -2(A6),D7
  165.     ble.w        sl2il2
  166.     addq.w        #1,-2(A6)
  167.     jmp        sl2il1
  168. sl2il2
  169.     movem.l        (SP)+,A4/D6/D7
  170.     unlk        A6
  171.     rts        
  172.     xdef        cycle
  173. cycle
  174.     link        A6,#-10   
  175.     movem.l        A3/A4/D5/D6/D7,-(SP)        
  176.     move.w        #1,-2(A6)
  177.     move.w        #140,D7
  178.     cmp.w        -2(A6),D7
  179.     blt.w        sl3il2
  180. sl3il1
  181.     move.w        -2(A6),D6
  182.     muls.w        #10,D6
  183.     lea        stars(A5),A4
  184.     lea        (A4,D6.w),A4
  185.     move.l        A4,-10(A6)
  186.     movea.l        -10(A6),A4
  187.     move.w        8(A4),-(SP)
  188.     movea.l        -10(A6),A4
  189.     move.w        6(A4),-(SP)
  190.     jsr.w        flippix
  191.     movea.l        -10(A6),A4
  192.     movea.l        -10(A6),A3
  193.     move.w        4(A3),D6
  194.     subq.w        #4,D6
  195.     move.w        D6,4(A4)
  196.     movea.l        -10(A6),A4
  197.     cmpi.w        #0,4(A4)
  198.     bgt.w        sl3il3
  199.     movea.l        -10(A6),A4
  200.     move.l        A4,-(SP)
  201.     jsr.w        makestar
  202.     jmp        sl3il4
  203. sl3il3
  204.     movea.l        -10(A6),A4
  205.     move.w        2(A4),D6
  206.     muls.w        #200,D6
  207.     movea.l        -10(A6),A4
  208.     ext.l        D6
  209.     divs.w        4(A4),D6
  210.     move.w        D6,-6(A6)
  211.     movea.l        -10(A6),A4
  212.     move.w        sorigin+2(A5),D6
  213.     add.w        -6(A6),D6
  214.     move.w        D6,8(A4)
  215.     movea.l        -10(A6),A4
  216.     move.w        (A4),D6
  217.     muls.w        #200,D6
  218.     movea.l        -10(A6),A4
  219.     ext.l        D6
  220.     divs.w        4(A4),D6
  221.     move.w        D6,-4(A6)
  222.     movea.l        -10(A6),A4
  223.     move.w        sorigin(A5),D6
  224.     add.w        -4(A6),D6
  225.     move.w        D6,6(A4)
  226.     move.w        -4(A6),D6
  227.     cmp.w        bounds+4(A5),D6
  228.     sge.b        D6
  229.     andi.w        #1,D6
  230.     move.w        -4(A6),D5
  231.     cmp.w        bounds(A5),D5
  232.     sle.b        D5
  233.     andi.w        #1,D5
  234.     or.b        D6,D5
  235.     move.w        -6(A6),D6
  236.     cmp.w        bounds+6(A5),D6
  237.     sge.b        D6
  238.     andi.w        #1,D6
  239.     or.b        D5,D6
  240.     move.w        -6(A6),D5
  241.     cmp.w        bounds+2(A5),D5
  242.     sle.b        D5
  243.     andi.w        #1,D5
  244.     or.b        D6,D5
  245.     beq.w        sl3il5
  246.     movea.l        -10(A6),A4
  247.     move.l        A4,-(SP)
  248.     jsr.w        makestar
  249.     jmp        sl3il6
  250. sl3il5
  251.     movea.l        -10(A6),A4
  252.     move.w        8(A4),-(SP)
  253.     movea.l        -10(A6),A4
  254.     move.w        6(A4),-(SP)
  255.     jsr.w        flippix
  256. sl3il6
  257. sl3il4
  258.     cmp.w        -2(A6),D7
  259.     ble.w        sl3il2
  260.     addq.w        #1,-2(A6)
  261.     jmp        sl3il1
  262. sl3il2
  263.     movem.l        (SP)+,A3/A4/D5/D6/D7
  264.     unlk        A6
  265.     rts        
  266.     xdef        smallflight
  267. smallflight
  268.     link        A6,#0    
  269.     jsr.w        initialize
  270.     move.w        #-1,-(SP)
  271.     clr.w        -(SP)
  272.     jsr.w        flushevents
  273. il1
  274.     jsr.w        cycle
  275.     clr.b        -(SP)
  276.     move.w        #10,-(SP)
  277.     pea        anevent(A5)
  278.     dc.w        $A970
  279.     move.b        (SP)+,D7
  280.     beq.w        il1
  281.     dc.w        $A9F4
  282.     xref        flippix
  283.     xref        flushevents
  284.